<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Dean <zxxjjforever@163.com>
// +----------------------------------------------------------------------
// API 模板文件，可以复制
namespace api\resource\controller;

use think\Db;
use think\Request;
use think\Validate;
use cmf\controller\RestBaseController;

class Biao30Controller extends RestBaseController
{


    public function one($data)
    {

        //查 这个表的数据
        @$new_data = $data[0]['content'];
        if (empty($new_data)) {
            return '';
        }

        @$text1 = $new_data->text1;
        @$text1 = json_decode($text1);

        @$radio1_one =  $new_data->radio1 == 1 ?"checked" :"";
        @$radio1_two =  $new_data->radio1 == 2 ?"checked" :"";

       $html = '
        <div style="width: 650px;margin: 0 auto;">
            <div style="font-size: 16px;font-weight: 600;margin-bottom: 15px;">八、重复申报自查</div>
            <table border="1" cellspacing="0px" cellpadding="5px" width="650">
                <thead>
                <tr>
                    <td colspan="6">
                        本项目（或其主要内容）是否同时获得或申报了除市科创委经费以外的其他财政资金资助，如是，请在下表填报相关情况：
                        <label>
                            <input type="radio" disabled="disabled" v-model="radio1" '.@$radio1_one.'  value="1">是
                        </label>
                        <label>
                            <input type="radio" disabled="disabled" v-model="radio1"  '.@$radio1_two.' value="0">否
                        </label>
                    </td>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td rowspan="2">序号</td>
                    <td rowspan="2">项目名称</td>
                    <td rowspan="2">项目负责人</td>
                    <td rowspan="2">申报单位</td>
                    <td colspan="2">申报其他财政资金情况</td>
                </tr>
                <tr>
                    <td>资金所属部门</td>
                    <td>金额（万元）</td>
                </tr>';


                @$i = 1;
                foreach (@$text1 as $v) {
                    $html .='
                            <tr>
                                <td>'.@$i.'</td>
                                <td>'.@$v->text1.'</td>
                                <td>'.@$v->text2.'</td>
                                <td>'.@$v->text3.'</td>
                                <td>'.@$v->text4.'</td>
                                <td>'.@$v->text5.'</td>
                            </tr>
                            ';
                    $i++;
                }

                $html .='
                </tbody>
            </table>
        </div>
        ';

            return $html;

    }



}
